﻿using System;
using Plugins;
using Utils;

namespace PluginSample2
{
	[Serializable]
	internal class StrategyControlData : PropertyChangedNotifierCopyable<StrategyControlData>, ICloneable<StrategyControlData>
	{
		#region Attributes

		private ExecutionDirection _executionDirection;
		private BarSource _barSource;
		private int _barQuantity;
		private int _quantityToBuy;
		private TimeSpan _barDuration;
		private bool _invertLogic;
		private bool _requirePureBars;
		
		#endregion

		#region  Properties

		public ExecutionDirection ExecutionDirection
		{
			get
			{
				return _executionDirection;
			}
			set
			{
				if (_executionDirection != value)
				{
					_executionDirection = value;
					base.OnPropertyChanged("ExecutionDirection");
				}
			}
		}

		public BarSource BarSource
		{
			get
			{
				return _barSource;
			}
			set
			{
				if (_barSource != value)
				{
					_barSource = value;
					base.OnPropertyChanged("BarSource");
				}
			}
		}

		public int BarQuantity
		{
			get
			{
				return _barQuantity;
			}
			set
			{
				if (_barQuantity != value)
				{
					_barQuantity = value;
					base.OnPropertyChanged("BarQuantity");
				}
			}
		}

		public TimeSpan BarDuration
		{
			get
			{
				return _barDuration;
			}
			set
			{
				if (_barDuration != value)
				{
					_barDuration = value;
					base.OnPropertyChanged("BarDuration");
				}
			}
		}

		public bool InvertLogic
		{
			get
			{
				return _invertLogic;
			}
			set
			{
				if (_invertLogic != value)
				{
					_invertLogic = value;
					base.OnPropertyChanged("InvertLogic");
				}
			}
		}

		public bool RequirePureBars
		{
			get
			{
				return _requirePureBars;
			}
			set
			{
				if (_requirePureBars != value)
				{
					_requirePureBars = value;
					base.OnPropertyChanged("RequirePureBars");
				}
			}
		}

		public int QuantityToBuy
		{
			get
			{
				return _quantityToBuy;
			}
			set
			{
				if (_quantityToBuy != value)
				{
					_quantityToBuy = value;
					base.OnPropertyChanged("QuantityToBuy");
				}
			}
		}

		#endregion

		#region ICloneable

		public StrategyControlData Clone()
		{
			return (StrategyControlData)this.MemberwiseClone();
		}

		#endregion
	}
}
